package com.example.androidsensors;

import android.hardware.Sensor;

public class SensorBean {
	private String name;
	private float x;
	private float y;
	private float z;
	private boolean active;
	private Sensor sensor;
	
	public SensorBean(){
		this.setName("");
		this.setX(0.0f);
		this.setY(0.0f);
		this.setZ(0.0f);
		this.isActive(false);
		this.sensor = null;
	}
	public SensorBean(Sensor mSensor, boolean active){
		this.setX(0.0f);
		this.setY(0.0f);
		this.setZ(0.0f);
		this.isActive(active);
		this.sensor = mSensor;
		switch(mSensor.getType()){
		case 1: this.setName("Accelerometr"); break;
		case 2: this.setName("Magnetic field"); break;
		case 3: this.setName("Orientation"); break;
		case 4: this.setName("Gyroscope"); break;
		case 5: this.setName("Light"); break;
		case 6: this.setName("Pressure"); break;
		case 7: this.setName("Temperature"); break;
		case 8: this.setName("Proximity"); break;
		case 9: this.setName("Gravity"); break;
		case 10: this.setName("Linear acceleration"); break;
		case 11: this.setName("Rotation vector"); break;
		case 12: this.setName("Relative humidity"); break;
		case 13: this.setName("Ambient temperature"); break;
		case 14: this.setName("Magnetic field uncalibrated"); break;
		case 15: this.setName("Game ratation vector"); break;
		case 16: this.setName("Gyroscope uncalibrated"); break;
		case 17: this.setName("Significant motion"); break;
		case 18: this.setName("Step detector"); break;
		case 19: this.setName("Step counter"); break;
		case 20: this.setName("Geomagnetic rotation vector"); break;
		}
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Sensor getSensor(){
		return this.sensor;
	}
	public void setSensor(Sensor sensor){
		this.sensor = sensor;
	}
	public float getX(){
		return this.x;
	}
	public void setX(float x){
		this.x = x;
	}
	public float getY(){
		return this.y;
	}
	public void setY(float y){
		this.y = y;
	}
	public float getZ(){
		return this.z;
	}
	public void setZ(float z){
		this.z = z;
	}
	public boolean isActive(){
		return this.active;
	}
	public void isActive(boolean active){
		this.active = active;
	}
}
